package com.zjp.spi;

import cn.hutool.core.util.ServiceLoaderUtil;

import java.util.ServiceLoader;

public class SpiMain {


    public static void main(String[] args) {


        SpiTest1();

    }

    private static void SpiTest1() {
        ServiceLoader<HelloService> serviceLoader = ServiceLoader.load(HelloService.class);
        for (HelloService service : serviceLoader) {
            service.sayHello();
        }
    }


    private static void SpiTest2() {
        ServiceLoaderUtil.load(HelloService.class);

    }

}
